<template>
  <div class="container">
    <van-nav-bar title="通知" left-text="返回" left-arrow @click-left="back" />
    <h1>{{ gongGao.name }}</h1>
    <img :src="gongGao.coverImage | dalImg" alt="" />
    <h1>详情</h1>
    <div v-html="gongGao.content"></div>
  </div>
</template>

<script>
import { loadGongDetail } from "../services/gonggao";
export default {
  data() {
    return {
      gongGao: {},
    };
  },
  async created() {
    const res = await loadGongDetail(this.$route.query.id);
    this.gongGao = res.data;
    console.log(this.gongGao);
  },
  methods: {
    back() {
      window.history.go(-1);
    },
  },
};
</script>

<style scoped>
img {
  width: 100%;
}
.container h1 {
  text-align: center;
}
</style>